﻿import flash.external.*

function buy()
{
	ExternalInterface.call("td_itembar.buy");
}
OkBtn.addEventListener("click", this, "buy");

function cancel()
{
	ExternalInterface.call("td_itembar.cancel");
}
CancelBtn.addEventListener("click", this, "cancel");
btnClose.addEventListener("click", this, "cancel");

function select_num(e:Object)
{
	ExternalInterface.call("td_itembar.select_num", e.index);
}
NumMenu.addEventListener("change", this, "select_num");
NumMenu.rowCount = 2;

lstSelectableNum = [];

function set_item(itemname:String, itemicon:String, cost:String, select_index:Number)
{
	NameLabel.text = itemname;
	icon.source = itemicon;
	PriceLabel.text = cost;
	NumMenu.dataProvider = lstSelectableNum;
	NumMenu.selectedIndex = select_index;
}